package com.example.project;

import android.app.Application;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.view.Window;
import android.view.WindowManager;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.example.project.db.DBManager;
import com.example.project.tool.SharePreferce;

public class MyApplication extends Application {
    private static Context context;
    private static RequestQueue queues;

    @Override
    public void onCreate() {
        super.onCreate();
        // 初始化数据库
        DBManager.initDB(getApplicationContext());

        context=getApplicationContext();
        //实例化全局队列
        queues= Volley.newRequestQueue(getApplicationContext());

    }

    public static Context getContext(){
        return context;
    }

    public static RequestQueue getHttpQueues(){
        return queues;
    }
    //记录登录id
    public static int getMainId(){
        int mainId= SharePreferce.getInstance( context).getInt("mainId");
        return mainId;
    }
}
